﻿using MediatR;
using RBAC.Common.Domains.RabbitProject;
using RBAC.Common.Dto;
using RBAC.Common.infrastructures.interfaces;
using RBAC.Enum;

namespace RBAC.api.Application.commond.deepprocessing
{
    public class DeepprocessingImagesHandler : IRequestHandler<DeepprocessingImagesCommond, Rulst>
    {

        private readonly IbaseRpository<ProductionPutImages> _ProductionPutImages;

        public DeepprocessingImagesHandler(IbaseRpository<ProductionPutImages> productionPutImages)
        {
            _ProductionPutImages = productionPutImages;
        }

        public async Task<Rulst> Handle(DeepprocessingImagesCommond request, CancellationToken cancellationToken)
        {


            var query = new Rulst() { Code = (int)Reult.success };

            var list = new ProductionPutImages()
            {
                Stypeid = Typenum.食品安全,
                ProDuctionBasicid = request.ProDuctionBasicid,
                PutImages = request.getimaegs,
                Putid = 0
            };

           query.data= _ProductionPutImages.Add(list);

            return query;

        }
    }
}
